using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class LU_departmentMap : EntityTypeConfiguration<LU_department>
    {
        public LU_departmentMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Name)
                .HasMaxLength(50);

            this.Property(t => t.Code)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Item)
                .HasMaxLength(10);

            this.Property(t => t.TPI_code)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("LU_department");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.Item).HasColumnName("Item");
            this.Property(t => t.Discount).HasColumnName("Discount");
            this.Property(t => t.TPI_code).HasColumnName("TPI_code");
            this.Property(t => t.TPI).HasColumnName("TPI");
        }
    }
}
